/**
 * 
 */
//展示window的UI
function showWindow() {
	var win = new Ext.Window({
		width:500,
		height: 400,
		title: "MyFirstWindow",
		buttons: [{text:"Confirm"},{text:"Cancel"}]
	});
	//调用show方法
	win.show();
}

//展示树UI
function showTree(){
	var tree = new Ext.tree.TreePanel({
		/*renderTo: 'tree-div',
		useArrows: true,
		autoScroll: true,
		animate: true,
		enableDD: true,
		containerScroll: true,
		border: false,*/
		width: 500,
		height: 300,
		title: 'treeTest',
		root: new Ext.tree.AsyncTreeNode({
			nodeType: 'async',
			text: '根节点',
			draggable: true,
			children: [{
				text: "子节点1",
				children:[{text:"孙节点1",leaf:true}]
			},{
				text: "子节点2",
			}]
			
		})
	});
	
	// 监听render方法
	tree.on("render",function(){
		console.log("The tree was show.");
	});
	// 组件渲染(绑定id为'hello'的div)
	tree.render("hello");
}
//通过Ext.onReady来开始调用Ext组件
Ext.onReady(showTree);